<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/report/report/View_ReportPrdInventory.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/report/report/View_ReportPrdInventory.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ID',
                footer: "Foots",
                cnName: '生产订单报表',
                name: 'report/View_ReportPrdInventory',
                url: "/View_ReportPrdInventory/",
                sortName: "CMONum"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"OrgCode":"","CMONum":"","ParentNum":"","Finished":""});
            const searchFormOptions = ref([[{"dataKey":"Org","data":[],"title":"组织","field":"OrgCode","type":"select"},{"dataKey":"enable","data":[],"title":"是否完工","field":"Finished","type":"radio"}],[{"title":"制造单号","field":"CMONum","type":"like"},{"title":"产品代码","field":"ParentNum","type":"like"}]]);
            const columns = ref([{field:'CMONum',title:'制造单号',type:'string',width:150,require:true,align:'left'},
                       {field:'MOType',title:'工单类别',type:'string',width:110,require:true,align:'left'},
                       {field:'DeptName',title:'生产部门',type:'string',width:110,align:'left'},
                       {field:'ParentNum',title:'产品代码',type:'string',width:220,require:true,align:'left'},
                       {field:'ParentName',title:'产品名称',type:'string',width:120,require:true,align:'left'},
                       {field:'FPrdQty',title:'生产计划数量',type:'decimal',width:110,require:true,align:'left'},
                       {field:'FPrdStockQty',title:'生产入库数量',type:'decimal',width:110,align:'left'},
                       {field:'FDate',title:'最后完工日期',type:'datetime',width:110,hidden:true,align:'left',sort:true},
                       {field:'FSubNum',title:'子项物料代码',type:'string',width:220,require:true,align:'left'},
                       {field:'FSubName',title:'子项物料名称',type:'string',width:120,require:true,align:'left'},
                       {field:'FMustQty',title:'需求数',type:'decimal',width:110,require:true,align:'left'},
                       {field:'FLossQty',title:'备料数',type:'decimal',width:110,require:true,align:'left'},
                       {field:'FPrdSumQty',title:'已领用数',type:'decimal',width:110,require:true,align:'left'},
                       {field:'FPrdSumTQty',title:'退料数',type:'decimal',width:110,require:true,align:'left'},
                       {field:'FPrdSumEndQty',title:'完工消耗',type:'decimal',width:110,align:'left'},
                       {field:'FPrdAllSumQty',title:'在制结存',type:'decimal',width:110,align:'left'},
                       {field:'Finished',title:'是否完工',type:'int',bind:{ key:'enable',data:[]},width:110,hidden:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
